<?php
declare (strict_types=1);

namespace app\exam\service;

use app\common\service\BaseService;
use app\exam\logic\Special as SpecialLogic;
use think\facade\Request;
use app\exam\logic\Point as PointLogic;

/**
 * 知识点类
 */
class Point extends BaseService
{

	/**
	 * 获取知识点列表
	 * Author 亓官雨树<lucky.max@foxmail.com>
	 * Date 2022-03-16
	 * @return [type] [description]
	 */
	public function getPointList()
	{
		$param = Request::get();
		$data  = app(PointLogic::class)->getPointList($param);

//        $data  = app(SpecialLogic::class)->getSpecialList($param);
		return $this->parseToData($data, 1, '获取成功');
	}

	/**
	 * 获取知识点分类列表
	 * Author 亓官雨树<lucky.max@foxmail.com>
	 * Date 2021-02-04
	 * @return [type] [description]
	 */
	public function getCategoryList()
	{
		$param = Request::get();
		$data  = app(PointLogic::class)->getCategoryList($param);

		return $this->parseToData($data, 1, '获取成功');
	}

	/**
	 * 获取选择知识点后的试题基本信息
	 * Author 亓官雨树<lucky.max@foxmail.com>
	 * Date 2021-02-04
	 * @return [type] [description]
	 */
	public function getPracticeBase()
	{
		$param = Request::get();
		$data  = app(PointLogic::class)->getPracticeBase($param);

		return $this->parseToData($data, 1, '获取成功');
	}

	/**
	 * 获取试题信息及选项
	 * Author 亓官雨树<lucky.max@foxmail.com>
	 * Date 2021-02-04
	 * @return [type] [description]
	 */
	public function getPointTopic()
	{
		$param = Request::get();
		$data  = app(PointLogic::class)->getPointTopic($param);

		return $this->parseToData($data, 1, '获取成功');
	}

	/**
	 * 提交知识点练习答案
	 * Author 亓官雨树<lucky.max@foxmail.com>
	 * Date 2021-02-04
	 * @return [type] [description]
	 */
	public function postTopicAnswer()
	{
		$param = Request::post();
		app(PointLogic::class)->postTopicAnswer($param);

		return $this->parseToData([], 1, '提交成功');
	}
}
